package com.bw.controller;

import com.bw.entity.Week;
import com.bw.service.WeekService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created by qpx on 2017/8/31.
 */
@RestController
public class WeekController {

    @Autowired
    @Qualifier("weekService")
    WeekService weekService;

    @RequestMapping("/list")
    public ModelAndView selectByAll(){
        ModelAndView modelAndView = new ModelAndView("list");
        List<Week> weeks = weekService.selectByAll();
        modelAndView.addObject("wlist",weeks);
        return modelAndView;
    }


    @RequestMapping("/ajax")
    public String selectByAllAjax(){
        return "hello word";
    }
}
